package gmail;

import java.util.ArrayList;
import java.util.TreeMap;

/**
 * Response from GMail
 * Sent from google after we initialize a request
 * @author siuying
 * @version 0.3
 */
public abstract class GMResponse {
  /**
   * General info in this account, required
   */
  protected TreeMap _gminfo;

  /**
   * Avaliable Label in this account, required
   */
  protected TreeMap _gmlabel;

  /**
   * Threads in the response, optional
   */
  protected ArrayList _threads;

  /**
   * Type of this response
   */
  public byte type = 0;

  public GMResponse(){
    _gminfo = new TreeMap();
    _gmlabel = new TreeMap();
  }

  public GMResponse(TreeMap gminfo, TreeMap gmlabel, ArrayList threads){
    _gminfo = gminfo;
    _gmlabel = gmlabel;
    _threads = threads;
  }

  public TreeMap getGminfo() {
    return _gminfo;
  }
  public TreeMap getGmlabel() {
    return _gmlabel;
  }
  public void setGminfo(TreeMap gminfo) {
    this._gminfo = gminfo;
  }
  public void setGmlabel(TreeMap gmlabel) {
    this._gmlabel = gmlabel;
  }
  public ArrayList getGMThreads() {
    return _threads;
  }
  public void setThreads(ArrayList threads) {
    this._threads = threads;
  }

  public String toString(){
    StringBuffer buf = new StringBuffer();

    buf.append("GMStandard: \n");
    buf.append("\tgminfo: " + _gminfo + ", \n");
    buf.append("\tgmlabel: " + _gmlabel + ", \n");
    buf.append("\tthreads: " + _threads + ", \n");

    return buf.toString();
  }


}
